<?php
class UserModuleController extends CController
{
	public $_toolbar=array();
	public $portlets1=array();
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
	 */
	public $layout =  '//../modules/admin_backend/views/layouts/sidebar_left';
	/**
	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
	 */
	public $menu=array();
	/**
	 * @var array the breadcrumbs of the current page. The value of this property will
	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
	 * for more details on how to specify this property.
	 */
	public $breadcrumbs=array();
	public function init()
	{
		/**
		 * Create menu left for user module
		 */
		$isAdmin = Yii::app()->getModule("user")->isAdmin();
		$this->portlets1 = array(
			"application.modules.admin_backend.widgets.PMenu_Left_Sidebar"	=>array(
				'items'	=>	array(
								'key1'=>array(
									'sub'	=>	array(
													array('label'	=>	UserModule::t('Create User'), 'url'	=>	$this->createUrl('/user/admin/create'), 'enable'=>$isAdmin),
													array('label'	=>	UserModule::t('List User'), 'url'	=>	$this->createUrl('/user'), 'enable'=>true),
													array('label'	=>	UserModule::t('Manage User'), 'url'	=>	$this->createUrl('/user/admin'), 'enable'=>$isAdmin),
													array('label'	=>	UserModule::t('Manage Profile Field'), 'url'	=>	$this->createUrl('/user/profileField/admin'), 'enable'=>$isAdmin),
													array('label'	=>	UserModule::t('Create Profile Field'), 'url'	=>	$this->createUrl('/user/profileField/create'), 'enable'=>$isAdmin),
												)
								),
				)
			),
		);
		parent::init();
	}
}